﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using Jumbot.Common;
using Jumbot.DataOper;

namespace JumbotCms.DataObject
{
    /// <summary>
    /// 专题表信息
    /// </summary>
    public class Special
    {
        private string m_Id = "0";
        private string m_Title = string.Empty;
        private string m_Info;
        private string m_Source;

        public string Id
        {
            get { return m_Id; }
            set { m_Id = value; }
        }
        public string Title
        {
            set { m_Title = value; }
            get { return m_Title; }
        }
        public string Info
        {
            set { m_Info = value; }
            get { return m_Info; }
        }
        public string Source
        {
            set { m_Source = value; }
            get { return m_Source; }
        }
        public Special()
        {
        }

        public void GetAllColumn(string _id, DbOperHandler doh)
        {

            doh.Reset();
            doh.SqlCmd = "SELECT * FROM [jcms_normal_special] WHERE [Id]=" + _id;
            DataTable dt = doh.GetDataTable();
            if (dt.Rows.Count > 0)
            {
                DataRow dr = dt.Rows[0];
                Id = _id;
                Title = dr["Title"].ToString();
                Info = dr["Info"].ToString();
                Source = dr["Source"].ToString();
            }
        }
        public string GetTitle(string _id, DbOperHandler doh)
        {
            doh.Reset();
            doh.SqlCmd = "SELECT [Title] FROM [jcms_normal_special] WHERE [Id]=" + _id;
            DataTable dt = doh.GetDataTable();
            if (dt.Rows.Count > 0)
            {
                return dt.Rows[0]["Title"].ToString();
            }
            return string.Empty;
        }
        public string GetInfo(string _id, DbOperHandler doh)
        {
            doh.Reset();
            doh.SqlCmd = "SELECT [Info] FROM [jcms_normal_special] WHERE [Id]=" + _id;
            DataTable dt = doh.GetDataTable();
            if (dt.Rows.Count > 0)
            {
                return dt.Rows[0]["Info"].ToString();
            }
            return string.Empty;
        }
        public string GetSource(string _id, DbOperHandler doh)
        {
            doh.Reset();
            doh.SqlCmd = "SELECT [Source] FROM [jcms_normal_special] WHERE [Id]=" + _id;
            DataTable dt = doh.GetDataTable();
            if (dt.Rows.Count > 0)
            {
                return dt.Rows[0]["Source"].ToString();
            }
            return string.Empty;
        }
    }
}
